using LiJ.Common.Core.Enums;

namespace LiJ.Common.Core
{
	/// <summary>
	///   ResultMo 扩展
	/// </summary>
	public static class ResultExtention
	{
		/// <summary>
		///  是否是Success
		/// </summary>
		/// <param name="res"></param>
		/// <returns></returns>
		public static bool IsSuccess(this ResultMo res)
		{
			return res.Ret == 0;
		}

		/// <summary>
		/// 是否是对应的结果类型
		/// </summary>
		/// <param name="res"></param>
		/// <param name="type"></param>
		/// <returns></returns>
		public static bool IsResultType(this ResultMo res, ResultTypes type)
		{
			return res.Ret == (int)type;
		}
	}
}
